#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+10;

int n, m, x;
struct Pn {
	int p;
	int c;
} pn[maxn];
struct Cn {
	int a;
	int b;
} pos[maxn], neg[maxn]; 

bool cmp_p(const Pn &pn1, const Pn &pn2) {
	if (pn1.p == pn2.p) {
		return pn1.c < pn2.c;
	}
	return pn1.p < pn2.p;
}
bool cmp_ab(const Cn &cn1, const Cn &cn2) {
	return (cn1.a - cn1.b) >= (cn2.a - cn2.b);
}
bool cmp_ba(const Cn &cn1, const Cn &cn2) {
	return (cn1.b - cn1.a) > (cn2.b - cn2.a);
}
int main() {
	cin >> n >> m >> x;
	for (int i = 1; i<=n; i++) {
		cin >> pn[i].p >> pn[i].c;
	}
	int pos_n = 0; 
	int neg_n = 0;
	long long sum = 0;
	for (int i=1; i<=m; i++) {
		int a, b;
		cin >> a >> b;
		if (a>=b) {
			pos[pos_n].a = a;
			pos[pos_n].b = b;
			pos_n ++;
		} else {
			neg[neg_n].a = a;
			neg[neg_n].b = b;
			neg_n ++;
		}
	}
	sort(pn+1, pn+n+1, cmp_p);
	sort(pos, pos + pos_n, cmp_ab);
	sort(neg, neg + neg_n, cmp_ba);
	
	int idx = 0;
	for (int i=1; i<=n; i++) {
		for (int j=1; j<=pn[i].c; j++) {
			sum += 2ll *pn[i].p * pos[idx].a 
					+ 2ll * (x - pn[i].p) * pos[idx].b;
			idx ++;	
			if (idx >= pos_n) {
				break;
			}
		}
		if (idx >= pos_n) {
			break;
		}
	}
	
	idx = 0;
	for (int i=n; i>=1; i--) {
		for (int j=1; j<=pn[i].c; j++) {
			sum += 2ll *pn[i].p * neg[idx].a 
					+ 2ll * (x - pn[i].p) * neg[idx].b;
			idx ++;	
			if (idx >= neg_n) {
				break;
			}
		}
		if (idx >= neg_n) {
			break;
		}
	} 
	
	cout << sum << endl;
	return 0;
}
